package com.fjl.test.init;

public class Example {
    final static int x = 10; // 编译期常量
    static int y = 9;        // 类变量
    final int z = 8;         // 实例变量
    int d = 6;               // 实例变量
	{
		System.out.println("普通代码块:"+"x= "+x  +"  y="+y  +"  z="+z  +"   d="+d);
	}
	static{
		System.out.println("静态代码块:"+"x= "+x  +"  y="+y );
	}

	public Example() {
		System.out.println("无参构造:"+"x= "+x  +"  y="+y  +"  z="+z  +"   d="+d);
	}
	public void test(){
		System.out.println("test:"+"x= "+x  +"  y="+y  +"  z="+z  +"   d="+d);

	}
	public static void main(String[] args) {
		Example e = new Example();
		e.test();

	}
}